module.exports = function (e) {
  switch ((console.log(e), e.type)) {
    case 'category':
      wx.setStorageSync('cat_id', e.param || 0),
        wx.switchTab({ url: '/pages/category/category' });
      break;
    case 'detail':
      wx.navigateTo({
        url: '/pages/goodsDetail/goodsDetail?goodsId='.concat(e.param),
      });
      break;
    case 'order':
      wx.navigateTo({ url: '/packageOrder/pages/orderList/orderList' });
      break;
    case 'richText':
      break;
    case 'coupon':
      wx.navigateTo({ url: '/pages/coupon/coupon?cameFrom=getCoupon' });
      break;
    case 'balance':
      wx.navigateTo({ url: '/pages/User/balanceRecharge/balanceRecharge' });
      break;
    case 'webview':
      if (-1 != e.param.indexOf('luckyDraw')) {
        var a = e.param.split('?')[1],
          r = e.param.split('?')[0].split('#/')[1];
        wx.navigateTo({
          url: '/pages/webview/webview?route='
            .concat(r, '&_query=')
            .concat(encodeURIComponent(a)),
        });
      } else if (-1 === e.param.indexOf('/h5act/index.html')) {
        var o = e.param.split('#/');
        wx.navigateTo({ url: '/pages/webview/webview?route='.concat(o[1]) });
      } else
        wx.navigateTo({
          url: '/pages/webview/webview?_query='.concat(
            encodeURIComponent(e.param),
          ),
        });
      break;
    case 'im':
      getCurrentPages()[getCurrentPages().length - 1].setData({
        showKefuDialog: !0,
      });
      break;
    case 'weiwei_home':
      wx.navigateTo({ url: '/pages/webview/webview?route=weiwei' });
  }
};
